export default defineContentScript({
  matches: ['<all_urls>'],
  async main(ctx: any) {
    console.log('Hello content.');
    browser.runtime.onMessage.addListener(function(message: { from: string; message: any; }, sender: any, sendResponse: any) {
      if (message.from === 'Service Worker') {
        console.log('Received message in Content Script:', message.message, document.activeElement);
        if (document.activeElement) {
          (document.activeElement as HTMLInputElement).value = message.message;
        }
      }
    });
  },
});
